package module.building.model.dataObj
{
	import code.obj.IconObj;

	/**
	 * 
	 * @author jichang
	 * 
	 */	
	public class EquipObj extends IconObj
	{ 
		public var skillList:Array;
		public var eqipName:String;
		public var attack:int;
		public var defence:int;
		public var needGold:int;
		public var needWood:int;
		public var needStone:int;
		public var needIron:int;
		public var time:int;
		public var type:String;
		
		override public function get iconClassName():String
		{
			return "MATERIAL_" + serverId + "_ICON";
		}
		
		public function EquipObj()
		{
		}
		/**
		 * {"gold":"1","atkRate":"2","atk":"27","wood":"1","armsId":"800001","range":"1","speed":"2.5","eqipName":"动员兵装备","iron":"1","crit":"7.5000000000000011E-2","def":"37","skillList":"","armsName":"动员兵","time":"3","type":"步兵","stone":"1","output":"1","equipId":"200001"},
		 * @return 
		 * 
		 */		
		public static function praseData(data:Object):EquipObj
		{
			var $weaponObj:EquipObj = new EquipObj();
			$weaponObj.serverId = data.equipId;
			$weaponObj.eqipName = data.eqipName;
			$weaponObj.skillList = String(data.skillList).split(",");
			$weaponObj.attack = data.atk;
			$weaponObj.defence = data.def;
			$weaponObj.needGold = data.gold;
			$weaponObj.needWood = data.wood;
			$weaponObj.needStone = data.stone;
			$weaponObj.needIron = data.iron;
			$weaponObj.time = data.time;
			$weaponObj.type = data.type;
			return $weaponObj;
		}
	}
}